<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>新增版本</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/common.css" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form" style="width:90%;">
    <div class="layui-form-item">
        <label class="layui-form-label">提醒手机号</label>
        <div class="layui-input-block">
            <input type="number" id="remindPhone" name="remindPhone" minlength="11" maxlength="11" class="layui-input"
                   placeholder="请输入提醒手机号">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="add">确认新增</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript">
    layui.config({
        base: "../../js/"
    }).use(['base', 'form', 'layer', 'jquery', 'laydate', 'tree', 'upload', 'layedit'], function () {
        var base = layui.base,
            form = layui.form,
            laydate = layui.laydate,
            upload = layui.upload,
            layedit = layui.layedit,
            layer = parent.layer === undefined ? layui.layer : parent.layer,
            $ = layui.jquery;

        form.on('submit(add)', function (data) {
            var index = top.layer.msg('数据提交中，请稍候', {icon: 16, time: false, shade: 0.8});
            $.ajax({
                type: 'get',
                url: 'product/addRemindPhone',
                data: {'phone': $('#remindPhone').val()},
                success: function (data) {
                    console.log(data);
                    top.layer.close(index);
                    if (data.code != 200) {
                        layer.msg(data.message, {icon: 2});
                        return false;
                    }
                    //弹出loading
                    setTimeout(function () {
                        top.layer.msg("操作成功！", {icon: 1});
                        layer.closeAll("iframe");
                        parent.location.reload();
                    }, 500);
                },
            });
            return false;
        });

    });

</script>
</body>
</html>
